package org.ubc.cs410.disposal2020;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.gwt.maps.client.geom.LatLng;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class BuildingBoundary {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	/*
	 * Keeping the data structure simple with two lists since I don't know if
	 * anything more complex is supported.
	 */

	@Persistent
	private Integer buildingId;
	@Persistent(defaultFetchGroup = "true")
	private List<Float> latitudes;
	@Persistent(defaultFetchGroup = "true")
	private List<Float> longitudes;

	// Empty Constructor
	public BuildingBoundary() {
	}

	public BuildingBoundary(Integer buildingId, List<Float> latitudes,
			List<Float> longitudes) {
		this.buildingId = buildingId;
		this.latitudes = latitudes;
		this.longitudes = longitudes;
	}

	public BuildingBoundary(int buildingId, Float latitude, Float longitude) {
		this.buildingId = new Integer(buildingId);
		this.latitudes = new ArrayList<Float>();
		latitudes.add(latitude);
		this.longitudes = new ArrayList<Float>();
		longitudes.add(longitude);
	}

	public Integer getBuildingId() {
		return buildingId;
	}

	public void setBuildingId(Integer buildingId) {
		this.buildingId = buildingId;
	}

	public List<Float> getLatitudes() {
		return latitudes;
	}

	public void setLatitudes(List<Float> latitudes) {
		this.latitudes = latitudes;
	}

	public void addLatitude(Float latitude) {
		this.latitudes.add(latitude);
	}

	public List<Float> getLongitudes() {
		return longitudes;
	}

	public void setLongitudes(List<Float> longitudes) {
		this.longitudes = longitudes;
	}

	public void addLongitude(Float longitude) {
		this.longitudes.add(longitude);
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

}
